let data = {
    text: "init"
}
const set = new Set()

data = new Proxy(data, {
    get(target, prop) {
        // console.log(target, prop);
        set.add(effect)
        return Reflect.get(...arguments)
    },
    set(target, prop, val) {
        Reflect.set(...arguments)
        set.forEach(ef => ef());
    }
})

function effect() {
    document.body.innerText = data.text
}

effect()
setTimeout(() => {
    data.text = "change"
}, 1000)
